#include <iostream>
#include <string>

using namespace std;

class Solution {
public:
    string longestPalindrome(string s) {
        int size = s.size();
        int countL = 0, countR = size-1;
        int len = 0;
        int max = 0;
        int ansL=0, ansR=0;
        while(countL < size) {
            bool res = check(s, countL, countR);
            if(res){
                len = countR - countL + 1;
                if(max < len) 
                {
                    ansL = countL;
                    ansR = countR;
                    max = len;
                }

            }
            if(max > size - countL);
            countR = size - 1;
            countL++;
        }
        // cout<<"ansL = "<<ansL<<" max = "<<max<<endl;
        return s.substr(ansL, max);
    }

    bool check(string s, int& left, int& right) {
        while(left < right) {
            while(s[left] != s[right]) right--;
            int i, j;
            for(i = left, j = right; i < j; i++, j--){
                if(s[i] != s[j]) break;
            }
            if (i >= j) return true;
            right--;
        }
        return false;
    }
};

int main(){
    Solution solution;
    string str;
    while(cin >> str){
        string res;
        res = solution.longestPalindrome(str);
        cout<<"结果是: "<<res<<endl;
    }
}
